#include<stdio.h>

/*c语言指针学习第14课：为结构体起别名*/

typedef struct Ultraman
{
    char name[100];
    int attack;
    int defense;
    int blood;
}M;//结构体别名为M



int main()
{
    M taro = {"泰罗",100,90,500};//这种数据格式为M
    M rem = {"雷欧",90,80,600};
    M eddie = {"艾迪",120,70,450};
    M tiga = {"迪迦",110,90,600};

    M arr[4] = {taro,rem,eddie,tiga};

    for (int i = 0; i < 4; i++)
    {
        M temp = arr[i];
        printf("%s奥特曼，攻击力为：%d，防御力为%d，血量为%d。\n",temp.name,temp.attack,temp.defense,temp.blood);
    }

    return 0;
}